package cn.pengpeng.dmp.utils

/**
  * 增强
  */
class NumParser (val str:String){
  def toIntPlus = try {
    str.toInt
  } catch {
    case _: Exception => 0
  }


  def toDoublePlus = try {
    str.toDouble
  } catch {
    case _: Exception => 0d
  }
}

/**
  * 增强方法
  */
object PengpengString{
  implicit def str2PengpengString(str:String) = new NumParser(str)
}
